package com.xy.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/*
 * @供应商表
 */
@SuppressWarnings("serial")
@Entity
@Table
@Cacheable
public class Supplier extends Identified implements Serializable {

  @Column(nullable = false)
  private String name;// 供应商名
  @Column(nullable = false)
  private String address;// 地址
  @Column(nullable = false)
  private String tel;// 电话
  @Column(nullable = false)
  private String contactMan;// 联系人
  @Column(nullable = false)
  private String email;// 邮箱
  private String remark;// 备注

  @OneToMany(targetEntity = StockReceive.class, mappedBy = "admin") // 入库
  private Set<StockReceive> stockReceives = new HashSet<StockReceive>();

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getAddress() {
    return address;
  }

  public void setAddress(String address) {
    this.address = address;
  }

  public String getTel() {
    return tel;
  }

  public void setTel(String tel) {
    this.tel = tel;
  }

  public String getContactMan() {
    return contactMan;
  }

  public void setContactMan(String contactMan) {
    this.contactMan = contactMan;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public Set<StockReceive> getStockReceives() {
    return stockReceives;
  }

  public void setStockReceives(Set<StockReceive> stockReceives) {
    this.stockReceives = stockReceives;
  }

  public Supplier() {
    super();
    // TODO Auto-generated constructor stub
  }

}
